package cn.colat.micse.order.controller;

import cn.colat.micse.common.pojo.vo.ResBody;
import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class IndexController {
    @RequestMapping("/")
    public ResBody<String> index() {
        return ResBody.success("Order Service Is running");
    }


    @PostMapping("/order-list")
    public ResBody<JSONObject> orderList() {
        JSONObject json = JSONObject.parseObject("{\"records\":[{\"orderId\":7,\"orderStatus\":3,\"payAmount\":43.80,\"unitAmount\":21.90,\"quantity\":2,\"spuId\":23,\"skuId\":106,\"spuName\":\"桂青源WOW手撕牛板筋香辣麻辣网红休闲小零食大条嚼劲春节年货\",\"skuName\":\"手撕牛板筋 WOW20袋香辣味(共300g)\",\"skuImage\":\"https://gw.alicdn.com/bao/uploaded/i2/3959124613/O1CN01qidbG61jwnubzucJc_!!3959124613.jpg\",\"specValue\":\"WOW20袋香辣味(共300g)\",\"refundStatus\":1}],\"total\":1,\"size\":10,\"pages\":1}");
        return ResBody.success(json);
    }
}
